package com.mcb_wxc.util;

import java.util.ArrayList;
import java.util.List;

public class MailSender {

	private static final String SENDER = "no-reply@xfj100.com";
	private static final String PASSWORD = "Aleck123";
	private static final String HOST = "smtp.mxhichina.com";
	
		
	//Mult File Email
	public static boolean sendNoreplyEmail (String title, String content, List<String> files, String to, String cc, String bcc) {
		Mail noreplyMail = new Mail(to, SENDER,HOST,title,SENDER,PASSWORD,cc,bcc);
		for (String file : files ) {
			noreplyMail.attachfile(file);
		}
		return noreplyMail.startSend(content, "text/html;charset=utf-8");
	}
	
	//Single File Email
	public static boolean sendNoreplyEmail(String title, String content, String file, String to, String cc, String bcc) {
		List<String> files = new ArrayList<String>();
		if (file != null && !file.equals("")) {
			files.add(file);
		}
		return sendNoreplyEmail(title, content, files, to, cc, bcc);
	}
	
	//Have NOT File Email
	public static boolean sendNoreplyEmail(String title, String content, String to, String cc, String bcc) {
		return sendNoreplyEmail(title, content, new ArrayList<String>(),to, cc, bcc);
	}
	
	
	
	public static void main(String[] args) {
		sendNoreplyEmail("测试", "测试内容", "735830934@qq.com", "", "");
	}
}
